import time
from selenium import webdriver
from selenium.webdriver.common.by import By

# 获取dr
dr = webdriver.Chrome()
dr.get("file:///C:/Users/Administrator/Desktop/自动化测试网页/自动化测试网页/注册A.html")
# 最大化网页
dr.maximize_window()
time.sleep(2)
dr.find_element(By.CSS_SELECTOR,"#linkto > a:nth-child(1)").click()
time.sleep(3)
# 后退
dr.back()
time.sleep(3)
# 前进
dr.forward()
time.sleep(3)
# 刷新
dr.refresh()
time.sleep(3)
# 后退
dr.back()
time.sleep(3)
# 点击
dr.find_element(By.ID,"fw").click()
time.sleep(3)
# 关闭当前窗口
dr.close()
time.sleep(2)
# 关闭浏览器
dr.quit()